package com.tkjt.pms.modules.common.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tkjt.pms.common.entity.TkIndexInfo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
public interface TkIndexInfoMapper extends BaseMapper<TkIndexInfo> {
    @Select("select distinct tii.index_Code,tii.index_Name  from tk_index_info tii where EXISTS ( SELECT 1 FROM tk_index_value_attrs tia  WHERE  tia.INDEX_VALUE_CODE = tii.INDEX_VALUE_CODE  AND tia.ATTR_CODE = 'orgGroup'  AND tia.attr_value = #{indexGroup})")
    List<Map<String, Object>> distinctIndexCode(@Param("indexGroup") String indexGroup);

    List<TkIndexInfo> selectByArrtsParam(Map<String,Object> param);

    List<TkIndexInfo> selectArrtsByParam(Map<String,Object> param);

    void updateIndexInfoOrderByParam(TkIndexInfo tkIndexInfo);
}
